<template>
  <el-dialog
    v-model="visible"
    title="请选择支付方式"
    width="80%"
    :close-on-click-modal="false"
  >
    <div>
      <iframe
        :src="payUrl"
        width="100%"
        height="800px"
        frameborder="0"
      ></iframe>
    </div>
  </el-dialog>
</template>

<script setup>
import { doAggPayment } from "@/api/customer_handle/index.js";
import { onMounted } from "vue";
const props = defineProps({
  value: {
    type: Boolean,
    default: false,
  },
  payUrl: {
    type: String,
    default: "",
  },
});

// const payUrl = ref("");

const emits = defineEmits(["update:value", "on-success"]);
const visible = computed({
  get() {
    return props.value;
  },
  set(val) {
    emits("update:value", val);
  },
});

async function getPayUrl() {
  try {
    const { data } = await doAggPayment(props.params);
    payUrl.value = data.url;
  } catch (error) {}
}

onMounted(() => {
  //   getPayUrl();
});
</script>
